home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Alles Voor Internet / Tout Pour Internet
/
alles voor internet.iso
/
MacInternet™
/
Unix
/
ps2epsmac1.3.shar
/
README
< prev
next >
Wrap
Text File
|
1993-05-21
|
10KB
|
279 lines
ps2eps-mac takes an arbitrary postscript file
( even sort of works with macintosh laserwriter driver dumps.. )
and creates an 'encapsulated postscript with embedded pict' file in
macbinary format.
This file can be included in certain programs ( eg Word5 ) that support
the format, and you will get a 72dpi screen preview image, but postscript
quality output on your postscript printer.
Note that there is no way to represent multi page documents using
the embeded pict format.
so far it has been used sucessfully with
MSWord 5 and its 'draw' module ( does _not_ work with MSW4 or lower )
OzTeX
Kalidagraph
a short list, sigh -- anything else?
to make use of this program you need ghostscript and pbmplus
..and you need to know how to transfer a macbinary file to your macintosh
in a nutshell -- set your unix transfer program to 'binary' and your
macintosh transfer program to 'macbinary'
quick and dirty usage is simply
ps2eps-mac file.ps
-which produces file.eps.bin
-which when transferred to your mac will be named "file.eps"
by default this will be a Word5 file, double clicking on this file will
open it in word5, with a nice screen image.
You can easily change the type/creator by setting shell variables
so that the eps file will open in your favorite eps compatible program.
notes-----------
usage
ps2eps-mac [ options ] file.ps
options can be any of..
-q -> quiet mode, overwrites scratch files without asking
-batch -> same as -q
-d -> where to put the output file, can be "stdout" to pipe output
to stdout ( automatically sets "-q" and sends errors to a log file )
-pipe, eqivalent to "-d stdout"
-log logfile -> send output messages to logfile
-debug n -> change debug level to n
-widen n or -widen unset -> override default widenbox value
environment variables
setenv EPSTYPE EPSF
setenv EPSCREATOR MSWD
to set the type and creator of the macintosh file
the defaults are EPSF,MSWD which let me double click
to open the file in MSWord 5, the defaults are defined in ps-pict2macbin.c
be sure that the following are on your path, or are in the
$ps2epsdir directory list
ps-pict2macbin
er_echo <well, you could live without this..>
( in the ps2eps-mac shell archive )
pnmcrop _or_ pnmcut < pnmcut works better i think, get both if you can >
pbmtoepsi
ppmtopict
( export.lcs.mit.edu ; contrib/pbm* )
gs
( prep.ai.mit.edu ; pub/gnu/ghost* )
macps
( sumex-aim.stanford.edu ; info-mac/unix )
macps is needed if the original ps file is a macintosh
laserwriter driver dump
acknowledgements -- in addition to the above programs, I learned a lot
( and maybe borrowed some code.. ) from
mcvert
macbin
ps2epsf Doug Crabill may notice that this shell script bears some
resemblence to his script ( which creates a pc compatable file )
the man page was contributed by jc@msc.edu
known bugs
translating line endings with tr is bound to mess up any binary stuff
in the source postscript -- try playing with the translate options
if someone knows a foolproof way to do line ending translation,
please give me a call...
explination of options that can be set in the ps2eps-mac script
{ for csh novices...
a shell variable can be 'set'
set x
or set to a value
set x = 1
or set to a list
set x = ( 1 A 4.5 )
the line,
#set x
is commented out, thus ( unless previously set ) x is 'unset'
in this program, all of the variables in the options section
may be 'set' or 'unset'. Some of them - where indicated -
must be set to values, if they are set. }
#set ps2epsdir = ( /usr/new/bin )
add directories to your search path.
you might need here the directorys containing
gs, pbm stuff, the ps-pict2macbin executable
line ending translation options -- a concern only if your ps contains
very long lines or binary data ( included fonts and such )
#set notranslate
leave unix line endings everywhere
notranslate _does_not_work_ with msword. -- does it work with anything???
#set notransfile
set notranslatefile to put mac line endings on only the first
two lines of the file -- this is a little wierd but it seems
to work. I am really curious if this is ok with ps interpreters
like freedom of the press. This 'aint gonna work when the
existing bounding box is used ( see bbinfo below )
#set havemacps
uncomment only if you have macps and you might be processing
a mac laserwriter driver generated file ( beware, you are on thin ice.. )
typically your 'eps' file will only print from a mac running a certain
laserwriter driver.
#set noshowpage
uncomment to add line to undefine showpage in the postscript [/showpage {} def]
only necessary if..
1)your ps contains showpage
2) your mac application doesn't like it ( eg Word )
..but it should never hurt.. ( yea right )
#set density = 72
do not use this -- changing the density changes the _size_ not the
resolution of the pict image , sigh. If somone 'fixes' ppmtopict to
have a resolution option me and my deskwriter will be greatful.
( value required, if set )
set widenbox = 1
the bounding box sometimes chops off edges of picture, this uses a hack to
widen the bb by $widenbox points
an error will result if the 'new' bounding box goes beyond the
edge of ghostscripts 'page' -- if your ps draws at the origin then
you cant widen the box ( try using a translate in the source ps )
note -- set widenbox = 0 is not exactly the same as leaving widenbox unset
-- pnmcut is used rather than pnmcrop ( in priciple the same result by a
different method )
widenbox can now be defined on the command line as well ( see usage )
whatever you do with it here is the default.
( value required, if set *integer only* )
#set bbinfo
with bbinfo not set, use the bounding box in the original ps file
( if one exists ) -- requires widenbox to be set as well.
bbinfo unset, and widenbox = 0
leaves the postscript 'data fork' completely
original if the original file contains a bounding box. Of course, if
the existing bounding box is wrong you will get garbage.
set widenboxbb = 0
if set, widenboxbb overrides widenbox in cases where existing
bounding box is used ( typically this should be zero I guess. )
widenbox still must be set to something for this to happen.
ie. the default operation is
no bounding box in original file -> calculate a box and widen by 1 point
bounding box in original file -> use it, no modification at all to postscript
( value required, if set )
please inform me, if you have problems with widenbox, as the pnmcrop
method of cropping the pict will be left out of future versions
if it is not needed.
set error = er_echo
error reporting program, in case the default er_echo does not compile,
there is a csh script st_echo. st_echo does not work with -log or -pipe
( value required )
#set log ps2eps.log
direct output to a log file rather than standard error. This really just
gets passed to $error
can be set with "-log file" on the command line
(value required if set )
set debuglev = 1
default debug level, passed to $error
0 -> only fatal error messages
1 -> lets you know what is going on
3 -> possably interesting stuff
4 ( or higher ) -> very verbose
can be overridden with "-debug n" on the command line
(value required if set )
#set quiet
make "-q" on by default ( overwrites files without asking )
this cannot be overriden on the command line
more usage notes are in the shell script 'ps2eps-mac'
this shell archive contains
makefile -- enter 'make' to compile..
ps2eps-mac -- executable shell script
ps-pict2macbin.c -- source for macbinary creating utility
test.ps -- simple test file
test-ex.eps.bin.uu -- example macbinary, created from test.ps
README -- this file
er_echo.c -- error handling c program
pbmtoepsi.c -- additional pbmplus source
ps2eps-mac.1 -- unix man page
version history
initial release 4/4/92
george jefferson george@mech.seas.upenn.edu
v.0.1 4/5/92
added options to modify line ending translation in ps2eps-mac script
( same action by default )
v.0.2 4/5/92
added code to widen the bounding box -- by 1 pt as default
better test.ps
v.0.3 4/6/92
corrections to documentation
change default file type to EPSF
fixed info header bug
pad resource fork to 128 byte bound ( suntar choked... )
v.0.4
now looks for a bounding box line in the source file and uses it
rather than using ppmtoepsi to calculate..
this feature is 'on' by default ( see bbinfo option )
explination of most options moved to this file from the shell script
v.0.5
I _think_ the bounding box is now calculated correctly in all cases.
v.0.6
added er_echo.c, which lets me do nice error reporting
( if er_echo fails to work, it is a bit superfluous, unset $error )
v.0.7
bypass ftime, for sysv machines
v.0.8
more sysv compatabilty modification
shortened ps-pict2macbin.c to ps-pict2macb.c
v.0.9
added pbmtoepsi source to distribution
v.0.91
fixed time() bug which caused crash on sun3's
v.1.0
included st_echo, although i dont know of any problems with er_echo
added man page, now i think we are ready to send to some ftp sites.
v.1.1
recognises gs2.4 multi-page output, aborts with an apropriate message.
v.1.2
compatability with several different BoundingBox formats
( atend )
non - integer values
box:x ( no space )
makes sure first line is %!PS-Adobe
even more saninty checking.
repaired major bug in ps-pict2macb.c, which caused mac to crash
with large images.
more output options
v.1.3
color support.
fixed ftp output